﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CS322_V10.primeri
{
    public class Time
    {
        // private member variables
        private int year;
        private int month;
        private int date;
        private int hour;
        private int minute;
        private int second;

        private static string Name;

        static Time()
        {
            Name = "Time";
        }

        public void DisplayCurrentTime()
        {
            System.Console.WriteLine("Name: {0}", Name);
            System.Console.WriteLine("{0}/{1}/{2} {3}:{4}:{5}",
               month, date, year, hour, minute, second);
        }

        // public accessor methods
        public void DisplayCurrentTime2()
        {

            System.Console.WriteLine(
               "Time\t: {0}/{1}/{2} {3}:{4}:{5}",
               month, date, year, hour, minute, second);
        }

        // constructors
        public Time(System.DateTime dt)
        {
            year = dt.Year;
            month = dt.Month;
            date = dt.Day;
            hour = dt.Hour;
            minute = dt.Minute;
            second = dt.Second;

            /*System.DateTime currentTime = System.DateTime.Now;
            Time t = new Time(currentTime);
            t.DisplayCurrentTime();

            int theHour = t.Hour;
            System.Console.WriteLine("\nRetrieved the hour: {0}\n",
               theHour);
            theHour++;
            t.Hour = theHour;
            System.Console.WriteLine("Updated the hour: {0}\n", theHour);*/
        }

        // create a property

        public int Hour
        {
            get
            {
                return hour;
            }

            set
            {
                hour = value;
            }
        }

    }


     

}
